﻿using AsscerMVCN2512.Models;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.Mvc;

namespace AsscerMVCN2512.Controllers
{
    public class AssetTypeInfoController : Controller
    {
        AssetDBEntities1 db = new AssetDBEntities1();
        // GET: AssetTypeInfo
        public ActionResult Index()
        {
            return View();
        }

        //获取所有资产类别信息
        public ActionResult GetALLData()
        {
            var list = db.AssetTypeInfo
                       .Select(x => new {
                           AssetTypeID = x.AssetTypeID,
                           AssetTypeName = x.AssetTypeName
                       })
                       .ToList();

            return Json(list, JsonRequestBehavior.AllowGet);
        }
    }
}